import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import com.supinfo.sun.sungamers.dao.impl.PersonFile;
import com.supinfo.sun.sungamers.enums.Sex;
import com.supinfo.sun.sungamers.person.Person;

/**
 * @author Liu, Bing(Locke)
 * @since 2011-06-05
 * @version 0.3
 */
public class LaunchPersons {

	public static void main(String[] args) {
		PersonFile pf = new PersonFile();
		
		Person p1 = new Person(1, "Locke", "Liu", Sex.MALE);
		Person p2 = new Person(2, "Locke2", "Liu", Sex.MALE);
		Person p3 = new Person(3, "Locke3", "Liu", Sex.MALE);
		Person p4 = new Person(4, "Locke4", "Liu", Sex.MALE);
		Person p5 = new Person(5, "Locke5", "Liu", Sex.FEMALE);
		
		List<Person> list = new ArrayList<Person>();
		list.add(p1);
		list.add(p2);
		list.add(p3);
		list.add(p4);
		list.add(p5);
		
		pf.savePersons(list);
		
		list = pf.getPersons();
		Iterator<Person> it = list.iterator();
		while(it.hasNext()) {
			System.out.println(it.next().getFirstName());
		}

	}

}
